<!--
 * @Author: zf
 * @Date: 2022-11-30 15:51:46
 * @LastEditTime: 2022-11-30 18:14:25
 * @Description: 
-->
<template>
  <div class="box">
    <div class="header">
      <div class="verticalBar"></div>
      <span>
        <slot></slot>
       
      </span>
    </div>
    <div class="buttonBox">
      <el-button type="primary" @click="exit">退出</el-button>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { ElMessage } from "element-plus";
import router from "../../router";

const exit = function () {
  localStorage.removeItem('token')
  localStorage.removeItem('adminAccountInfo')
  router.push('/login')
  ElMessage.success({
    message: '退出成功'
  })
}
</script>
<style scoped>
.box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 50px;
  background: linear-gradient(to right, gray 0%, rgb(222, 218, 218) 100%);
}
.header {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding-left: 15px;
}
.verticalBar {
  width: 6px;
  height: 60%;
  background-color: #1e9fff;
  margin-right: 10px;
}
.buttonBox {
padding-right:10px ;
}
</style>
